#
# component Makefile.
#
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)

# $(COMPONENT_PATH)
OLA_SDK_PATH ?= ../ola-wifi-device-sdk

LIBS += ola
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH)/${OLA_SDK_PATH}/ola/lib \
                           $(addprefix -l,$(LIBS))

COMPONENT_ADD_INCLUDEDIRS += ${OLA_SDK_PATH}/ola/inc
COMPONENT_ADD_INCLUDEDIRS += ${OLA_SDK_PATH}/ola/inc/auth
COMPONENT_ADD_INCLUDEDIRS += ${OLA_SDK_PATH}/ola/inc/softap

OLA_EXAMPLE_C_FILES =	./ola_device_demo_main.c

COMPONENT_ADD_INCLUDEDIRS += ./
COMPONENT_SRCDIRS += ./
COMPONENT_OBJS += $(OLA_EXAMPLE_C_FILES:%.c=%.o)


OLA_PAL_C_FILES =	${OLA_SDK_PATH}/pal/src/ola_memory.c	\
			${OLA_SDK_PATH}/pal/src/ola_socket.c	\
			${OLA_SDK_PATH}/pal/src/ola_softap.c	\
			${OLA_SDK_PATH}/pal/src/ola_stdio.c	\
			${OLA_SDK_PATH}/pal/src/ola_string.c	\
			${OLA_SDK_PATH}/pal/src/ola_thread.c	\
			${OLA_SDK_PATH}/pal/src/ola_flash.c	\
			${OLA_SDK_PATH}/pal/src/ola_http.c	\
			${OLA_SDK_PATH}/pal/src/ola_coap.c	\
			${OLA_SDK_PATH}/pal/src/ola_time.c

COMPONENT_ADD_INCLUDEDIRS += ${OLA_SDK_PATH}/pal/inc
COMPONENT_ADD_INCLUDEDIRS += $(IDF_PATH)/examples/common_components/protocol_examples_common
COMPONENT_SRCDIRS += ${OLA_SDK_PATH}/pal/src
COMPONENT_OBJS += $(OLA_PAL_C_FILES:%.c=%.o)


CFLAGS += -D__ESP_32_PAL__
CFLAGS += -Wno-error=unused-label -Wno-error=maybe-uninitialized -Wno-error=implicit-function-declaration -Wno-error=pointer-sign -Wno-error=char-subscripts -Wno-error=sizeof-pointer-memaccess -Wno-error=format
